{include file='_header'}
<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item['id'])}编辑{else}添加{/if}教师<small>{if !empty($item['id'])}修改【{$item['teachername']}】{/if}</small></span>
</div>
<div class="page-content">
    <div class="page-sub-toolbar">
         <span class=''>
            <a class="btn btn-primary btn-sm" href="{:url('merch/shop/teacheradd')}">添加教师</a>
        </span>
    </div>
    <form action="" method="post" class="form-horizontal form-validate" enctype="multipart/form-data">
        <input type="hidden" name="id" value="{$item['id']}" />
        <div class="form-group">
            <label class="col-lg control-label">排序</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" class="form-control" name="sort" value="{$item['sort']}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label must">选择会员</label>
            <div class="col-sm-9 col-xs-12">
                   {:tpl_selector('mid',array('key'=>'id', 'required'=>true, 'text'=>'nickname', 'thumb'=>'avatar','placeholder'=>'昵称/姓名/手机号','buttontext'=>'选择会员 ', 'items'=>$teacher,'url'=>url('admin/member/query',array('no_wa'=>1))))}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label must">教师名称</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" class="form-control" name="teachername" value="{$item['teachername']}" data-rule-required="true"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label must">擅长</label>
            <div class="col-sm-9 col-xs-12 ">
                <input type="text" id='business' name="business" class="form-control" value="{$item['business']}" data-rule-required="true"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label must">标签</label>
            <div class="col-sm-9 col-xs-12 ">
                <input type="text" id='label' name="label" class="form-control" value="{$item['label']}" data-rule-required="true"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">性别</label>
            <div class="col-sm-9 col-xs-12">
                <label class="radio-inline">
                    <input type="radio" name='gender' value="1" {if $item['gender']==1 || empty($item['gender'])}checked{/if} /> 男
                </label>
                <label class="radio-inline">
                    <input type="radio" name='gender' value="2" {if $item['gender']==2}checked{/if} /> 女
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">教师图片</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_image2('thumb',$item['thumb'])}
                <span class="help-block">教师logo 建议尺寸 372 * 513</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">状态</label>
            <div class="col-sm-9 col-xs-12">
                <label class="radio-inline">
                    <input type="radio" name='status' value="1" {if $item['status']==1}checked{/if} /> 开启
                </label>
                <label class="radio-inline">
                    <input type="radio" name='status' value="0" {if empty($item['status'])}checked{/if} /> 关闭
                </label>
            </div>
        </div>
        <div class="form-group-title">教师介绍</div>
        <div class="form-group">
            <label class="col-lg control-label">教师简介</label>
            <div class="col-sm-9 col-xs-12">
                <textarea name="desc" class="form-control textarea">{$item['desc']}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">详情</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_ueditor('content',$item['content'],array('height'=>'200'))}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label"></label>
            <div class="col-sm-9 col-xs-12">
                <input type="submit" value="提交" class="btn btn-primary"  />
                <input type="button" name="back" onclick='history.back()' style='margin-left:10px;' value="返回列表" class="btn btn-default" />
            </div>
        </div>
    </form>
</div>
{include file='_footer'}